package com.wyh.docker.controller;

import com.wyh.docker.model.Student;
import com.wyh.docker.service.StudentService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author wuyuhan
 * @date 2021/5/30 20:10
 */
@RestController
@RequestMapping(value = "/student")
public class StudentController {

    @Resource
    private StudentService studentService;

    /**
     * 新增
     * @author wyh
     * @date 2021/05/30
     **/
    @RequestMapping("/insert")
    public Object insert(Student student){
        return studentService.insert(student);
    }

    /**
     * 刪除
     * @author wyh
     * @date 2021/05/30
     **/
    @RequestMapping("/delete")
    public Object delete(int id){
        return studentService.delete(id);
    }

    /**
     * 更新
     * @author wyh
     * @date 2021/05/30
     **/
    @RequestMapping("/update")
    public Object update(Student student){
        return studentService.update(student);
    }

    /**
     * 查询 根据主键 id 查询
     * @author wyh
     * @date 2021/05/30
     **/
    @RequestMapping("/load")
    public Object load(int id){
        return studentService.load(id);
    }


}
